﻿@section HeaderSection
   {
    <link href="../Content/Styles/create_poll_page.css" rel="stylesheet" type="text/css" />
   }
   
<script type="text/javascript">
    var toggleVideo = true
    var toggleImage = true;

    $(document).ready(function () {

        //        $('a[id=gotopreview]').click(function () {
        //            window.location.href = '/rippollwebmvc/poll/preview';
        //            return false;
        //        });

        $('div[id="imageuploaddiv"]').hide();
        $('div[id="videouploaddiv"]').hide();

        $('a[id=gotofinalize]').click(function () {
            $('form#create4Form').submit();
            return false;
        });

        $('input[id="imagefile"]').focusout(function () {
            $('div[id="imageuploaddiv"]').hide();
        });

        $('input[id="youtubelink"]').focusout(function () {
            $('div[id="videouploaddiv"]').hide();
        });

        $('img[id="uploadimage"]').click(function () {
            if ($('#radioImgVd2').is(':checked')) {
                if (toggleImage == true) {
                    $('div[id="imageuploaddiv"]').show();
                }
                else {
                    $('div[id="imageuploaddiv"]').hide();
                }
                toggleImage = !toggleImage;
            }
        });

        $('img[id="uploadvideo"]').click(function () {
            if ($('#radioImgVd1').is(':checked')) {
                if (toggleVideo == true) {
                    $('div[id="videouploaddiv"]').show();
                }
                else {
                    $('div[id="videouploaddiv"]').hide();
                }
                toggleVideo = !toggleVideo;
            }
        });


        $('input[id=radioImgVd1]').click(function () {
            $('div[id="imageuploaddiv"]').hide();
            $('div[id="videouploaddiv"]').show();
            toggleVideo = !toggleVideo;
        });


        $('input[id=radioImgVd2]').click(function () {
            $('div[id="imageuploaddiv"]').show();
            $('div[id="videouploaddiv"]').hide();
            toggleImage = !toggleImage;
        });

    });

    function CallMe1() {
        if (toggleImage == true) {
            $('div[id="imageuploaddiv"]').show();
        }
        else {
            $('div[id="fileuploaddiv"]').hide();
        }
        toggleImage = !toggleImage;
    }

    function CallMe2() {
        if (toggleVideo == true) {
            $('div[id="videouploaddiv"]').show();
        }
        else {
            $('div[id="videouploaddiv"]').hide();
        }
        toggleVideo = !toggleVideo;
    }


 </script>
 @model RipPoll.Library.PollPE
        
@{
    ViewBag.Title = "   Create Poll";
    ViewBag.PageDivId = "headerCreatePoll2";
    ViewBag.Margin = "";
} 


  <form id="create4Form" action="save" method="post" enctype="multipart/form-data">
  <div id="stepBoxMain">
 <img src="../content/images/rippoll_icon_black.jpg" width="56" height="51" align="middle" /><span class="topText"> You're on your way to making a
  rippoll that just might bring about a change in today's society.</span> <br />
</div>

<div id="createPageLeft">

<div class="stepBoxText" id="stepBox">
  <a href="/rippollwebmvc/poll/create1">1. Pick a category</a></div>

<div class="stepBoxText" id="stepBox">
  <a href="/rippollwebmvc/poll/create2">2. Create your question</a></div>

<div class="stepBoxText" id="stepBox">
  <a href="/rippollwebmvc/poll/create3">3. Choose your format</a></div>

<div class="stepBoxText" id="stepBox1">
4. Enhance your rippoll</div>
Click one of the above to go back and edit a previous step
</div>
<div id="createPageRight">
 <img src="../content/images/step_4.jpg" width="533" height="42" />
    
 <div id="inputBox"><span class="blueBoldText">Choose your image format</span> <span class="mediumGreyText">Link to a YouTube video or upload an image of your choice </span><span class="redText"><a href="#">(requirements)</a>
 <br />
 </span>
 <div style="position:relative; background: #FFC; border:2px solid #FC9; height:50px; width:550px; float:none; margin-bottom:10px" id="imageuploaddiv">
    <input type="file" name="imagefile" id="imagefile" size="50px" style="vertical-align:bottom; margin-left:10px;margin-top:10px" onchange="javascript:CallMe1();" />
</div>
<div style="position:relative;background: #FFC; border:2px solid #FC9; height:50px; width:550px; float:none; margin-bottom:10px" id="videouploaddiv">
        <input type="text" name="youtubelink" id="youtubelink" size="50px" style="vertical-align:bottom; margin-left:10px;margin-top:10px" onchange="javascript:CallMe2();" />
        <br />
        &nbsp;&nbsp;&nbsp;(copy You tube url above)
</div>
   <table width="77%" align="center" cellpadding="10" cellspacing="0">
     <tr>
       <td width="9%">
            <label>
                @if(!string.IsNullOrEmpty(Model.VideoLink)){
                <input type="radio" name="radioImgVd" id="radioImgVd1" value="video" checked="checked" />
                    }
                    else
                    {
                    <input type="radio" name="radioImgVd" id="radioImgVd1" value="video" />
                }
            </label>
       </td>
       <td width="21%">
            @if(Model != null && string.IsNullOrEmpty(Model.VideoLink)){
                <img src="../content/images/youtube_logo_large.jpg" width="92" height="92" alt="YouTube" id="uploadvideo">
                <a href="@Model.VideoLink"></a> </img>
            }
            else
            {
                <img src="../content/images/youtube_logo_large.jpg" width="92" height="92" alt="YouTube" id="uploadvideo"  />
            }
        </td>
       <td width="29%">&nbsp;</td>
       <td width="10%"><label>
        @if (Model != null && !string.IsNullOrEmpty(Model.ImagePath))
        {
         <input type="radio" name="radioImgVd" id="radioImgVd2" value="image" checked="checked" />
        }
        else
        {
            <input type="radio" name="radioImgVd" id="radioImgVd2" value="image" />
        }
       </label></td>
       <td width="31%">
            @if (Model != null && !string.IsNullOrEmpty(Model.ImagePath))
            {
                var imgPath = "../content/images/uploads/" + System.IO.Path.GetFileName(Model.ImagePath);
            <img src="@imgPath" width="113" height="92" alt="Upload an Image" id="uploadimage"></img>
            }
            else
            {
                <img src="../content/images/upload_image.jpg" width="113" height="92" alt="Upload an Image" id="uploadimage" />
            }
        </td>
     </tr>
   </table>
   <br />
       <br />
       <a id='gotopreview'><img src="../content/images/preview_rippoll.jpg" alt="Click here to go to Step 2" width="239" height="28" border="0" onclick="MM_openBrWindow('/rippollwebmvc/poll/preview','','scrollbars=yes,width=820,height=700')" /></a><br />
       <br />
       <a id='gotofinalize'><img src="../content/images/after_preview.jpg" alt="After preview, finalize your rippoll" width="239" height="28" border="0" onclick="MM_openBrWindow('../Commonpages/rippoll_created.html','','width=322,height=360')" /></a> <br />
 </div>
 <br />
 <span class="viewCategory"><br />
 <br />
 <br />
 <br />
 <strong>Learn how to make your rippoll look great.</strong></span> <br />
Read our <span class="blueHiliteText"><a href="#">recommended settings</a>.</span><br />
     <br />
     <span class="viewCategory"><strong>Still have questions?</strong></span> <span class="blueHiliteText"><a href="#">Watch this tutorial</a></span> or <span class="blueHiliteText"><a href="#">ask for help</a></span>.</div>

  <div id="stepBoxMain">
    <span class="regularText">All polls submitted will be reviewed by our internal audit dept. to make sure they’re not slanderous, malicious, derogatory and basically in poor taste.  Keep it clean.  We want our polls to be taken seriously, since they may deal with local, state, national and worldwide issues.  We strive very hard to make sure that this is a positive experience for those submitting polls and those viewing  and responding to your polls.</span>
</div>

</form>